package day03;

public class ForExercise {
    public static void main(String[] args){
        System.out.println(jie(6));

        System.out.println(fei(10));
    }

    public static long jie(int n){
        long result = 1L;
        for(int i = 1; i <=n ;i++){
            result*=i;
        }
        return result;
    }

    public static int fei(int n){
        if(n==1 || n==2)
            return 1;
        int start = 1;
        int end = 1;
        int result = 0;
        for (int i = 3;i<=n; i++){
            result =  start + end;
            start = end;
            end = result;
        }
        return result;
    }
}
